<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:c="http://java.sun.com/jstl/core"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:t="http://myfaces.apache.org/tomahawk">

<f:view>
	<f:loadBundle var="messages" basename="messages" />

	<head>
	<title>#{messages['comentarioList.title']}</title>
	<style type="text/css">
@import
	url(#{facesContext.externalContext.requestContextPath}/styles/myfaces.css)
	;
</style>
	</head>

	<h:form id="editComentario">
		<h:commandButton value="Add Comentario" action="add" id="add"
			immediate="true" styleClass="button" />

		<!-- Error from this table is caused by http://issues.apache.org/jira/browse/TOMAHAWK-466 -->
		<t:dataTable id="comentarios" var="comentario"
			style="margin-top: 10px" value="#{comentarioList.comentarios}"
			rows="25" sortColumn="#{comentarioList.sortColumn}"
			sortAscending="#{comentarioList.ascending}"
			styleClass="scrollerTable table" headerClass="standardTable_Header"
			rowClasses="standardTable_Row1,standardTable_Row2"
			columnClasses="standardTable_Column,standardTable_Column,standardTable_Column,standardTable_Column,standardTable_ColumnCentered">
			<t:column>
				<f:facet name="header">
					<t:commandSortHeader columnName="id" arrow="true">
						<h:outputText value="#{messages['comentario.id']}" />
					</t:commandSortHeader>
				</f:facet>
				<h:commandLink action="#{comentarioForm.edit}"
					value="#{comentario.id}">
					<f:param name="id" value="#{comentario.id}" />
				</h:commandLink>
			</t:column>
			<t:column>
				<f:facet name="header">
					<t:commandSortHeader columnName="texto" arrow="true">
						<h:outputText value="#{messages['comentario.texto']}" />
					</t:commandSortHeader>
				</f:facet>
				<h:outputText value="#{comentario.texto}" />
			</t:column>
			<t:column>
			<t:column>
				<f:facet name="header">
					<t:commandSortHeader columnName="conteudoComentado" arrow="true">
						<h:outputText value="#{messages['comentario.conteudoComentado']}" />
					</t:commandSortHeader>
				</f:facet>
				<h:outputText value="#{comentario.conteudoComentado.titulo}" />
			</t:column>
			<f:facet name="header">
				<t:commandSortHeader columnName="dataPostagem" arrow="true">
						<h:outputText value="#{messages['comentario.dataPostagem']}" />
					</t:commandSortHeader>
			</f:facet>
				<h:outputText value="#{comentario.dataPostagem}" />
			</t:column>
		</t:dataTable>

		<ui:include src="/tableFooter.xhtml">
			<ui:param name="tableName" value="comentarios" />
		</ui:include>

		<script type="text/javascript">
	highlightTableRows("editComentario:comentarios");
</script>
	</h:form>

</f:view>
</html>